<?php
//模型
class CourseModel extends MY_Model {
	function __construct(){
		parent::__construct();
		$this->table = 'course';
	}
	//分页列表
	function get_list($shop_id,$cid,$status=0,$size=100){
	
		if(empty($status)){
			$where = " cid = '{$cid}' AND shop_id ='{$shop_id}' AND status = 1 ";
		}
		else{
			$where = " cid != '{$cid}' AND shop_id ='{$shop_id}' AND status = 1 ";
		}

		$sql  = "select *  from ".$this->db->dbprefix.$this->table."  where {$where} limit {$size}";
		
		$query = $this->db->query($sql);
		$res = $query->result_array();		

		
		return $res;		
	}

	function get_info($uid,$cid){
		$info = $this->_id_get_info($cid);
		
		return $info;
	}
	
}

